package com.car.rental.vehicle.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.car.rental.vehicle.dto.VehicleQueryDTO;
import com.car.rental.vehicle.dto.VehicleSearchDTO;
import com.car.rental.vehicle.entity.Vehicle;
import com.car.rental.vehicle.dto.VehicleAddDTO;
import com.car.rental.vehicle.vo.VehicleListVO;
import com.car.rental.vehicle.vo.VehicleDetailVO;
import com.car.rental.vehicle.dto.VehicleUpdateDTO;
import org.springframework.web.multipart.MultipartFile;
import com.car.rental.vehicle.model.request.VehicleAddRequest;
import com.car.rental.common.core.response.ResponseResult;

import java.util.Map;

public interface VehicleService extends IService<Vehicle> {
    // 更新车辆状态
    boolean updateStatus(Long id, String status);
    
    // 检查车辆是否可用
    boolean isAvailable(Long id);
    
    // 高级查询
    Page<Vehicle> queryVehicles(VehicleQueryDTO queryDTO, Integer current, Integer size);
    
    // 批量更新车辆状态
    boolean batchUpdateStatus(Long[] ids, String status);
    
    // 高级搜索
    Page<Vehicle> search(VehicleSearchDTO searchDTO, Integer current, Integer size);
    
    // 按状态统计车辆数量
    Map<String, Long> countByStatus();

    Page<VehicleListVO> getVehicleList(Integer current, Integer size, String type, String brand);

    VehicleDetailVO getVehicleDetail(Long id);

    String uploadImage(MultipartFile file);

    boolean save(VehicleAddDTO addDTO);

    boolean update(VehicleUpdateDTO updateDTO);

    ResponseResult<Void> updateStatus(Long vehicleId, Integer status);

    ResponseResult<Void> addVehicle(VehicleAddRequest request, MultipartFile image);

    /**
     * 获取商家的车辆列表
     */
    Page<VehicleListVO> getMerchantVehicles(Long merchantId, Integer current, Integer size);

    /**
     * 将维修中的车辆标记为可用
     */
    ResponseResult<Void> markAsAvailable(Long vehicleId, Long merchantId);
} 